package com.sc.nft.entity.vo.mall;

import cn.hutool.core.util.StrUtil;
import com.sc.nft.enums.MallOrderRefundStatusEnum;
import com.sc.nft.enums.MallOrderRefundTypeEnum;
import com.sc.nft.enums.RefundReasonEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class RefundDetailsVO {

    @ApiModelProperty(value = "订单id")
    private Long id;

    @ApiModelProperty(value = "订单商品id")
    private Long orderProductId;

    @ApiModelProperty(value = "退款数量")
    private Integer count;

    @ApiModelProperty(value = "拒绝原因(商家)")
    private String refundReason = StrUtil.EMPTY;
    @ApiModelProperty(value = "退款原因(用户)")
    private String refundReasonWap;

    @ApiModelProperty(value = "退款金额")
    private String refundPrice;

    @ApiModelProperty(value = "退款类型 ONLY_REFUND:仅退款")
    private MallOrderRefundTypeEnum refundType;

    @ApiModelProperty(value = "退款图片 格式: xxx.jpg,xxx.jpg")
    private String imgUrl;

    @ApiModelProperty("缩略图")
    private String thumbnail;

    @ApiModelProperty("售后状态 NOT_APPLY:未申请 APPLYING:申请中 REFUSE_REFUND:拒绝退款 REFUNDING:退款中 REFUND_SUCCES:已退款")
    private MallOrderRefundStatusEnum refundStatus;

    @ApiModelProperty("是否取消退款  true:是 false:否")
    private Boolean isCancel;

    public void setRefundPrice(BigDecimal refundPrice) {
        this.refundPrice = refundPrice.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
    }
}
